package com.bawei.property.entity

import com.bawei.network.BaseResponse
import com.blankj.utilcode.util.GsonUtils
import org.json.JSONArray
import java.io.Serializable

/**
 * 车位颜色返回实体
 */
data class CarColorResultEntity(
    val values: String
): BaseResponse(){
    fun getValues(): List<CarColorValue> {
        var list = mutableListOf<CarColorValue>()
        var data = JSONArray(values)
        for (i in 0 until data.length()){
            list.add(GsonUtils.fromJson(data[i].toString(), CarColorValue::class.java))
        }
        return list
    }
}

data class CarColorValue(
    var colorId: Int,
    var colorValue: String,

): Serializable